<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gson</title>
<script type="text/javascript" src="../jquery/jquery-1.6.1.js"></script>
</head>
<body>
<hr color="red">
id:<select name="id" id="id"></select>
name:<select name="name" id="name"></select>
</body>
<script type="text/javascript">
$(function(){
	$.post(
		"/test/Ajax05",
		function(data){
			var users = data;
			$("#id").empty();
			$("#name").empty();
			for(var i=0;i<$(users).size();i++){
				/*通过点直接获取Json数据*/
				var id = users[i].id;
				var name = users[i].name;
				var idoption = "<option value="+id+">"+id+"</option>";
				var nameoption = "<option value="+name+">"+name+"</option>";
				$("#id").append(idoption);				
				$("#name").append(nameoption);				
			}
		}
	);
});
</script>
</html>